//
//  CeoBusCell.m
//  JinChengYun
//
//  Created by 金橙云 on 2017/4/17.
//  Copyright © 2017年 金橙云. All rights reserved.
//

#define N_WID [UIScreen mainScreen].bounds.size.width
#import "CeoBusCell.h"

@implementation CeoBusCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        NSInteger m = (N_WID-10*5)/4;
        NSInteger n = 10;
        
        _dayLab = [[UILabel alloc] init];
        _dayLab.textAlignment = NSTextAlignmentCenter;
        _dayLab.text = @"2017-09-11";
        _dayLab.textColor = [UIColor blackColor];
        // _dayLab.backgroundColor = [UIColor redColor];
        _dayLab.font = [UIFont systemFontOfSize:12];
        [self addSubview:_dayLab];
        [_dayLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(m , 20));
            make.left.equalTo(self.mas_left).offset(n);
            make.top.equalTo(self.mas_top).offset(10);
        }];
        
        
        _qiLab = [[UILabel alloc] init];
        _qiLab.textAlignment = NSTextAlignmentCenter;
        _qiLab.text = @"2期";
        _qiLab.textColor = [UIColor blackColor];
        //_qiLab.backgroundColor = [UIColor redColor];
        _qiLab.font = [UIFont systemFontOfSize:12];
        [self addSubview:_qiLab];
        [_qiLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(m, 20));
            make.left.equalTo(_dayLab.mas_right).offset(n);
            make.top.equalTo(self.mas_top).offset(10);
           // make.centerX.mas_equalTo(-M_WID);
        }];
        

        
        _wuLab = [[UILabel alloc] init];
        _wuLab.textAlignment = NSTextAlignmentCenter;
        _wuLab.text = @"商业";
        _wuLab.textColor = [UIColor blackColor];
        //_wuLab.backgroundColor = [UIColor redColor];
        _wuLab.font = [UIFont systemFontOfSize:12];
        [self addSubview:_wuLab];
        [_wuLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(m, 20));
            make.left.equalTo(_qiLab.mas_right).offset(n);
            make.top.equalTo(self.mas_top).offset(10);
           // make.centerX.mas_equalTo(M_WID);
        }];
        
        
        _shenLab = [[UILabel alloc] init];
        _shenLab.textAlignment = NSTextAlignmentCenter;
        _shenLab.text = @"同意执行";
        _shenLab.textColor = [UIColor colorWithHexString:@"#006400"];
        // _shenLab.backgroundColor = [UIColor redColor];
        _shenLab.font = [UIFont systemFontOfSize:12];
        [self addSubview:_shenLab];
        [_shenLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(m, 20));
            make.right.equalTo(self.mas_right).offset(-n);
            make.top.equalTo(self.mas_top).offset(10);
        }];
        
        

        
        
    }
    return self;
}

-(void)setBusCellWithDateLab:(NSString *)_date withQishu:(NSString *)_qi withWuType:(NSString *)_type withStatue:(NSString *)_statue withShenStr:(NSString *)_shen
{
    _dayLab.text = _date;
    _qiLab.text = _qi;
    _wuLab.text = _type;
    if ([_statue isEqualToString:@"1"])
    {
        _shenLab.text = _shen;
        _shenLab.textColor = [UIColor blackColor];
    }
    else if ([_statue isEqualToString:@"2"])
    {
        _shenLab.text = _shen;
        
        _shenLab.textColor = [UIColor colorWithHexString:@"#006400"];
        
    }
    else
    {
        _shenLab.text = _shen;
        _shenLab.textColor = [UIColor redColor];
        
    }
    _shenLab.text = _shen;
    
    
    
}
- (void)awakeFromNib {
    [super awakeFromNib];


}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
